import request from '@/config/axios'

// 幸运盲盒中奖记录 VO
export interface LuckyHistoryVO {
  id: number // 主键
  userId: number // 用户编号
  userName: string // 用户名称
  prizeId: number // 奖品id
  phone: number // 手机号
  prizeName: string // 奖品名称
  prizeType: number // 奖品类型
  specification: string // 规格
}

// 幸运盲盒中奖记录 API
export const LuckyHistoryApi = {
  // 查询幸运盲盒中奖记录分页
  getLuckyHistoryPage: async (params: any) => {
    return await request.get({ url: `/promotion/lucky-history/page`, params })
  },

  // 查询幸运盲盒中奖记录详情
  getLuckyHistory: async (id: number) => {
    return await request.get({ url: `/promotion/lucky-history/get?id=` + id })
  },

  // 新增幸运盲盒中奖记录
  createLuckyHistory: async (data: LuckyHistoryVO) => {
    return await request.post({ url: `/promotion/lucky-history/create`, data })
  },

  // 修改幸运盲盒中奖记录
  updateLuckyHistory: async (data: LuckyHistoryVO) => {
    return await request.put({ url: `/promotion/lucky-history/update`, data })
  },

  // 删除幸运盲盒中奖记录
  deleteLuckyHistory: async (id: number) => {
    return await request.delete({ url: `/promotion/lucky-history/delete?id=` + id })
  },

  // 导出幸运盲盒中奖记录 Excel
  exportLuckyHistory: async (params) => {
    return await request.download({ url: `/promotion/lucky-history/export-excel`, params })
  },
}